object work2 {
  def main(args: Array[String]): Unit = {
    for(num<- 100 to 999){
      val hundreds = num / 100 % 10
      val tens = num /10 % 10
      val ones = num %10

      if(Math.pow(hundreds,3) + Math.pow(tens,3) + Math.pow(ones,3) == num){
        println(num)
      }
    }
  }

}
